echo off
mkdir logs
copy %~dp0\sql\checkdep.sql logs\
set logfile=logs\%2.dep_%db2_server_name%.out
echo where ROOTSCHEMA = upper('%1') >>logs\checkdep.sql 
echo     and ROOTNAME = upper('%2')                        >>logs\checkdep.sql 
echo ORDER BY ROOTTYPE, ROOTSCHEMA, ROOTNAME, LEVEL      >>logs\checkdep.sql 
echo @                                                   >>logs\checkdep.sql 
call esql logs\checkdep.sql %logfile%
start %logfile%
